<template>
   <div >
        <div v-for="(item,index) in routers" :key="index+item">
          <el-submenu
          :index="`${item.id}`"
          v-if="item.children"
          >
            <template slot="title">
              <i class="el-icon-location"></i>
              <span slot="title" v-text="item.meta"></span>
            </template>
            <el-menu-item-group>

              <!-- <template slot="title">分组一</template> -->
              <!-- <el-menu-item :index="`${item.path}`" :route="item">
                <i class="el-icon-star-off"></i>
                <span v-text="item.meta">选项1</span>
              </el-menu-item> -->
                <Menu :routers="item.children" :key="item.path"></Menu>
            </el-menu-item-group>
          </el-submenu>
          <el-menu-item :index="`${item.id}`" v-else :route="item">
              <i class="el-icon-menu"></i>
               <!-- {{routes}} -->
              <span  v-text="item.meta">导航二</span>
          </el-menu-item>

      </div>
    </div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
export default {
  name: "Menu",
  props: {
    routers: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  data() {
    return {};
  },
  mounted(){
console.log(this.routers,'---------')
  },
  // computed:{
  //   ...mapGetters("admin", ["routes"])
  // }
};
</script>

